const Router = require('koa-router')
const { verifyAuth, verifyMoment } = require('../middleware/auth.middleware')
const momentRouter = new Router({ prefix: "/moment" })
const { create, getMomentById, getMomentList, deleteMonentById, picInfo } = require('../controller/moment.controller')

// 上传动态
momentRouter.post("/", verifyAuth, create)

// 获取单条动态
momentRouter.get("/", getMomentById)

// 获取动态列表
momentRouter.get("/list", getMomentList)
// 删除动态
momentRouter.delete("/", verifyAuth, verifyMoment, deleteMonentById)

// 获取动态配图
momentRouter.get("/pic/:momentId/:filename", picInfo)

module.exports = momentRouter
